package com.lixinlei.log.service;

import com.lixinlei.log.model.SmsResult;
import com.lixinlei.log.util.LogUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * 验证在枚举单例中日志的输出
 */
public enum SmsCatEnumInstanceMock {

    INSTANCE {

        private final Logger LOG = LoggerFactory.getLogger(SmsCatEnumInstanceMock.class);

        public synchronized SmsResult send(String port, String receiver, String content) {
            LogUtil.info(LOG, "---------java.com.obsec.service.SmsCatEnumInstanceMock.send--------");
            SmsResult smsResult = new SmsResult();
            smsResult.setDetail("SENT");
            smsResult.setStatus("ok");
            return smsResult;
        }

        public void close() {}

    };

    public abstract SmsResult send(String port, String receiver, String content);
    public abstract void close();

    public static SmsCatEnumInstanceMock getInstance() {
        return INSTANCE;
    }

}
